/******************************************************************************/
/*                                                                            */
/*                     Basic mathematical functions                           */
/*                       for use in C programming                             */
/*                                                                            */
/*                         by C. Bach 07-2011                                 */
/*                        bach@gfz-potsdam.de                                 */
/*                                                                            */
/*                                                                            */
/******************************************************************************/

#include "nrutil.h"
#include <stdio.h>
#include <math.h>


/* minimum of double vector */
double dmin(long length, double *vector, long *index);

/* minimum of integer vector */
int imin(int *vector, long length);

/* maximum of double vector */
double dmax(double *vector, long length);

/* maximum of integer vector */
int imax(int *vector, long length);

/* mean of double vector */
double dmean(double *vector, long length);

/* mean of integer vector, returns double value                               */
double imean(int *vector, long length);

/* sum of double vector */
double dsum(double *vector, long length);

/* sum of integer vector */
int isum(int *vector, long length);

/* linear vertical least squares fit for (x,y) points                         */
/* returns constants a and b as: y = a + bx                                   */
int lsfit(double *x, double *y, long n, double *a, double *b);

/* from Numerical Recipes in C */
int moment(double data[], int n, double *mean, double *adev, double *sdev, double *var, double *skew, double *curt);

int dshift(double *a, double *b);

void mmult(double **A, double **B, double **C, int m, int n);

void mtrans(double **A, double **B, int m, int n);

void printmatrix(double **A,int m,int n);

void mrot3(double **Stress, double **Result, double degree);

void madd(double **A, double **B, double **C, int m, int n);

